package com.imageflowpro.image_flow_pro.controller.admin;

import com.imageflowpro.image_flow_pro.dto.UserListDTO;
import com.imageflowpro.image_flow_pro.po.User;
import com.imageflowpro.image_flow_pro.result.Result;
import com.imageflowpro.image_flow_pro.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("adminUserController")
@RequestMapping("/admin")
//管理端，账号表接口
public class UserController {

    @Autowired
    private IUserService iUserService;

    @PostMapping("/updatePersonalInformationById")
    public Result<User> updatePersonalInformationByIdAdmin(@RequestBody User user){
        return Result.success(iUserService.updatePersonalInformationByIdAdmin(user));
    }

    @GetMapping("/user/getUserList")
    public Result<UserListDTO> adminGetUserList(){
        return Result.success(iUserService.adminGetUserList());
    }
}
